#import "DreamscapeZipperController.h"
        
#import "DreamscapeZipperModel.h"
#import "DreamscapeZipperCell.h"
#import "Masonry.h"

@interface DreamscapeZipperController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *hoverYearningCollectionView;
@property (nonatomic, strong) NSMutableArray *gritDataSource;

@end

@implementation DreamscapeZipperController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self cactusInitview];
	[self laughfetchData];
}


//: 获取数据模型
- (void)laughfetchData {
	
}

- (void)cactusInitview {
    UICollectionViewFlowLayout *blossom = [[UICollectionViewFlowLayout alloc] init];
    blossom.minimumLineSpacing = 10;
    blossom.minimumInteritemSpacing = 10;
    blossom.itemSize = CGSizeMake(100, 100);
    blossom.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    self.hoverYearningCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:blossom];
    self.hoverYearningCollectionView.backgroundColor = UIColor.clearColor;
    self.hoverYearningCollectionView.delegate = self;
    self.hoverYearningCollectionView.dataSource = self;
    self.hoverYearningCollectionView.showsHorizontalScrollIndicator = NO;
    self.hoverYearningCollectionView.showsVerticalScrollIndicator = NO;
    [self.hoverYearningCollectionView registerClass:[DreamscapeZipperCell class] forCellWithReuseIdentifier:NSStringFromClass([DreamscapeZipperCell class])];
    
    [self.view addSubview:self.hoverYearningCollectionView];
    [self.hoverYearningCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)gritDataSource {
	if (!_gritDataSource) {
		_gritDataSource = [NSMutableArray array];
	}
	return _gritDataSource;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.gritDataSource.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    DreamscapeZipperCell *alchemyYarn = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([DreamscapeZipperCell class]) forIndexPath:indexPath];
    return alchemyYarn;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
